﻿using ServicioTecnico.Negocio;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ServicioTecnico.UI
{
    public partial class frmClienteSelector : Form
    {
        public int cliente_id { get; set; }
        public frmClienteSelector()
        {
            InitializeComponent();
        }


        private void GetClientes()
        {
            var query = Clientes.FindAll();

            foreach (var row in query)
            {
                dgvClientes.Rows.Add(String.Format("{0:0000}", row.id), row.apellido, row.nombres, row.documento, row.direccion);
            }
        }

        private void frmClienteSelector_Load(object sender, EventArgs e)
        {
            GetClientes();
        }

        private void btRegistrar_Click(object sender, EventArgs e)
        {
            cliente_id = Convert.ToInt32(dgvClientes.CurrentRow.Cells[0].Value);
        }
    }
}
